package a.stategy;

public class CashContext {

    //声明一个CashSuper对象
    private CashSuper cs;

    public CashContext(String type){
        switch (type){
            case "正常收费":
                cs=new CashNormal();
                break;
            case "打八折":
                cs=new CashRebate("0.8");
                break;
            case "返利":
                cs=new CashReturn(300,100);
                break;
        }

    }

    public Double GetResult(Double money){
        return cs.acceptCash(money);
    }

}
